<?php
class Default_Forms_UploadVideoForm extends Zend_Form {
	function init() {
		$this->setAction('')
				->setMethod('POST')
				->setAttrib('class','form-horizontal');
				
		$video = $this->createElement('text', 'video');
		$video->setRequired ( true )
		            ->addFilter('StringTrim')
		            ->setAttrib('class','form-control')
		            ->setLabel('Đường dẫn đến video');
		            
		$title = $this->createElement('text', 'title');
		$title->setRequired ( true )
		            ->addFilter('StringTrim')
		            ->setAttrib('class','form-control')
		            ->setLabel('Tiêu đề video');
		            
		$submit = $this->createElement('submit','submit',array ('label' => 'Đăng video' ,'class'	=>'btn btn-default'));
		
		$cancel = $this->createElement('submit','cancel',array ('label' => 'Bỏ qua' ,'class'	=>'btn btn-default'));
		
		$this->addElement($video)
				->addElement($title)
				->addElement($submit)
				->addElement($cancel);
		$this->setDecorators(array('FormElements',array('HtmlTag',array('tag'	=> 'div','width'=>'100%')),'form'));
		$this->setElementDecorators(array(
										'ViewHelper',
										'Errors',
										'Description',
										array(	
											array('data'	=> 'HtmlTag'),
											array('tag'		=> 'div','class'	=> 'col-md-6')),
										array('label',
											array('class'	=> 'col-md-3 control-label')),
										array(
											array('row'	=> 'HtmlTag',),
											array('class'=>'form-group')
		        						)
									)
								);
		$submit->setDecorators(array(
								'ViewHelper',
						       ));
		$cancel->setDecorators(array(
								'ViewHelper',
									)
						       );
	}
}